#ifndef     __SENSOR_H
#define     __SENSOR_H

#include "../utils/nocopyable.h"
#include <stdint.h>

namespace ice_driver {

class Sensor : public NoCopyable {

public:
    void init();

    void read_temp();

    uint16_t stir_speed();
    
    bool is_ice_full();

    bool is_bucket_high();

    bool is_bucket_low();

    bool is_leak();

    inline bool is_all_ok() const {
        return m_env_ok && m_evap_ok;
    }

    inline bool is_env_ok() const {
        return m_env_ok;
    }

    inline bool is_evap_ok() const {
        return m_evap_ok;
    }

    inline int8_t env_temp() {
        return m_env_temp;
    }

    inline int8_t evap_temp() {
        return m_evap_temp;
    }

private:
    bool m_env_ok = false;
    int8_t m_env_temp = 0;
    bool m_evap_ok = false;
    int8_t m_evap_temp = 0;
};

extern Sensor sensor;

}



#endif
